home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / latex209 / contrib / misc / showlabels.sty < prev    next >
Text File  |  1989-12-21  |  1KB  |  29 lines

  1. % showlabels.sty
  2. % gil@svax.cs.cornell.edu (Gil Neiger)
  3. %
  4. % Change \label, \ref, and \pageref to show labels in line
  5. %
  6.  
  7. \def\ref#1{\@ifundefined{r@#1}{\mbox{\tt#1?}\@warning
  8.    {Reference `#1' on page \thepage \space 
  9.     undefined}}{\edef\@tempa{\@nameuse{r@#1}}\expandafter
  10.     \@car\@tempa \@nil\null}}
  11.  
  12. \def\pageref#1{\@ifundefined{r@#1}{\mbox{\tt#1?}\@warning
  13.    {Reference `#1' on page \thepage \space 
  14.     undefined}}{\edef\@tempa{\@nameuse{r@#1}}\expandafter
  15.     \@cdr\@tempa\@nil\null}}
  16.  
  17. \def\label#1{\@bsphack\if@filesw {\let\thepage\relax
  18.     \xdef\@gtempa{\write\@auxout{\string
  19.         \newlabel{#1}{{\@currentlabel}{\thepage}}}}}\@gtempa
  20.     \if@nobreak \ifvmode\nobreak\fi\fi\fi\@esphack
  21.     \mbox{\tt[#1]}}
  22.  
  23. \def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi
  24.   \def\@citea{}\@cite{\@for\@citeb:=#2\do
  25.     {\@citea\def\@citea{,}\@ifundefined
  26.        {b@\@citeb}{\mbox{\tt\@citeb?}\@warning
  27.        {Citation `\@citeb' on page \thepage \space undefined}}%
  28. \hbox{\csname b@\@citeb\endcsname}}}{#1}}
  29.